package QL;

import java.util.List;
import java.util.ArrayList;
import net.sf.json.JSONArray;
import net.sf.json.JSONObject;

public class ButlerPlayerResourceLog implements IQLResponse
{
    /// <summary>
    /// 物品名称
    /// </summary>
    public String ItemName;

    /// <summary>
    /// 变化原因
    /// </summary>
    public String Reason;

    /// <summary>
    /// 资源变化前的数量
    /// </summary>
    public long Value;

    /// <summary>
    /// 资源变化量
    /// </summary>
    public long Delta;

    /// <summary>
    /// 行为发生时间
    /// </summary>
    public String CreateTime;

    @Override
    public void DeserializeFromJson(JSONObject jsonObj)
    {
        JSONObject t = jsonObj;
        if (t.has("item_name"))
            ItemName = t.getString("item_name");
        if (t.has("reason"))
            Reason = t.getString("reason");
        if (t.has("value"))
            Value = t.getLong("value");
        if (t.has("delta"))
            Delta = t.getLong("delta");
        if (t.has("create_time"))
            CreateTime = t.getString("create_time");
    }
}
